# -*- makefile -*-
#
# arch/arm/MCONFIG
#
# Special rules for this architecture.  Note that this is actually
# included from the main Makefile, and that pathnames should be
# accordingly.
#

CPU_ARCH ?= armv4
CPU_TUNE ?= strongarm

KLIBCOPTFLAGS += -Os -march=$(CPU_ARCH) -mtune=$(CPU_TUNE)
KLIBCBITSIZE  = 32
KLIBCREQFLAGS += -fno-exceptions
KLIBCSTRIPFLAGS += -R .ARM.exidx

ifeq ($(CONFIG_KLIBC_THUMB),y)
CPU_ARCH := $(CPU_ARCH)t
KLIBCREQFLAGS += -mthumb
KLIBCLDFLAGS  += --thumb-entry _start
KLIBCEMAIN     = --thumb-entry _start
KLIBCREQFLAGS += -mabi=aapcs-linux
KLIBCSHAREDFLAGS = -Ttext 0x380200
else
# Extra linkflags when building the shared version of the library
# This address needs to be reachable using normal inter-module
# calls, and work on the memory models for this architecture
KLIBCSHAREDFLAGS = -Ttext 0x01800200
ifeq ($(CONFIG_AEABI),y)
KLIBCREQFLAGS += -mabi=aapcs-linux -mno-thumb-interwork
else
KLIBCREQFLAGS += -mabi=apcs-gnu -mno-thumb-interwork
endif
endif
